using System;
using System.Collections.Generic;
using System.Text;

namespace SharpMud.Terminal
{
    /// <summary>
    /// This interface encapsulates mechanisms for reading and writing data to a terminal
    /// </summary>
	public interface IInteractiveTerminal : IOutputTerminal
	{
        /// <summary>
        /// Reads a character of input from the terminal, blocking for input, and consuming the character when acquired.
        /// </summary>
        /// <returns>Waits for input and returns and consumes the next character available.</returns>
        char Read();

        /// <summary>
        /// Reads a character of input from the terminal, NOT blocking for input, and NOT consuming it when acquired.
        /// </summary>
        /// <returns>Returns the next character available without waiting for one, or consuming it when it gets it. If no data available, returns -1.</returns>
        int Peek();

        /// <summary>
        /// Reads a line of text from the terminal, blocking for input, and consuming the text when acquired.
        /// </summary>
        /// <returns>Waits for input and returns and consumes the next line of text available.</returns>
        string ReadLine();

        /// <summary>
        /// Gets or sets the encoding for data as it is read from the terminal
        /// </summary>
        System.Text.Encoding InputEncoding { get;set;}
	}
}
